package com.ruoyi.product.es;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.product.domain.SysProdAtta;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @Author: tsh
 * @Date: 2025/8/8 21:25
 * @Description: TODO
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "es_product")
@Setting(shards = 1,replicas = 0)
public class EsProd implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 商品ID */
    @Id
    @Field(type = FieldType.Keyword)
    private Integer prodId;

    /** SPU */
    @Excel(name = "SPU")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodSpu;

    /** 商品类型 */
    @Excel(name = "商品类型")
    @Field(type = FieldType.Integer)
    private Integer prodKind;

    /** 商品分类 */
    @Excel(name = "商品分类")
    @Field(type = FieldType.Integer)
    private Integer prodType;

    /** 商品状态 */
    @Excel(name = "商品状态")
    @Field(type = FieldType.Integer)
    private Integer prodStatus;

    /** 商品名称 */
    @Excel(name = "商品名称")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodName;

    /** 商品品牌 */
    @Excel(name = "商品品牌")
    @Field(type = FieldType.Integer)
    private Integer brandId;

    /** 商品单位 */
    @Excel(name = "商品单位")
    @Field(type = FieldType.Integer)
    private Integer unitId;

    /** 商品标签 */
    @Excel(name = "商品标签")
    @Field(type = FieldType.Integer)
    private Integer tagId;

    /** 供应商 */
    @Excel(name = "供应商")
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String appr;

    /** 缩略图 */
    @Excel(name = "缩略图")
    @Field(type = FieldType.Keyword,index = false)
    private String prodImage;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String  typeName;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String  brandName;

    /** 创建者 */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String createBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8",shape = JsonFormat.Shape.STRING)
    @Field(type = FieldType.Date,format = {},pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 更新者 */
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8",shape = JsonFormat.Shape.STRING)
    @Field(type = FieldType.Date,format = {},pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;




}
